/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [Circle.java]
 * Creation Date        [12-Jul-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_02_gui.sketchpad.shape;

import java.awt.Color;
import java.awt.Graphics;

/**
 * 圆形
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public class Circle implements Shape {

	// 圆的颜色
	private Color circleColor;
	// 圆心的坐标
	private int x, y;
	// 圆的半径
	private int radius;

	public Circle() {
		super();
	}

	public Circle(int x, int y, int radius, Color circleColor) {
		super();
		this.circleColor = circleColor;
		this.x = x;
		this.y = y;
		this.radius = radius;
	}

	@Override
	public void paint(Graphics g) {
		g.setColor(circleColor);
		// 画弧, 当弧的宽度和高度一致且从0~360度时就是原形了
		g.drawArc(x, y, radius, radius, 0, 360);
	}
}
